package com.hlyue.ingress.consecutiveportalhacking;

import android.app.Notification;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;

/**
 * Created by Richard on 2015/8/27.
 */
public class OverlayViewService extends Service {
    private WindowManager mWindowManager;
    private ImageView mImageButton;

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        Log.d(TAG, "onCreate");
        NotificationUtils.doSendNotification(this);

//        mWindowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
//        mImageButton = new ImageView(this);
//        mImageButton.setImageResource(android.R.drawable.ic_input_add);
//        WindowManager.LayoutParams params = new WindowManager.LayoutParams(
//                WindowManager.LayoutParams.WRAP_CONTENT,
//                WindowManager.LayoutParams.WRAP_CONTENT);
//        params.gravity = Gravity.TOP | Gravity.RIGHT;
//        params.verticalMargin = 200;
//        addView(mImageButton, params);
    }


    private void addView(final View view, final WindowManager.LayoutParams params) {
        mWindowManager.addView(view, params);
    }

    @Override
    public void onDestroy() {
        Log.d(TAG, "onDestroy");
        super.onDestroy();
    }
    private final String TAG = OverlayViewService.class.getName();
}
